package com.example.speeddating.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.speeddating.entity.Feedback;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:33
 */
@Mapper
public interface FeedbackMapper extends BaseMapper<Feedback> {

    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "user_id",property = "userId"),
            @Result(column = "article_id",property = "articleId"),
            @Result(column = "user_id",property = "user",one = @One(select = "com.example.speeddating.mapper.UserMapper.selectByUserId")),
    })
    @Select("SELECT * FROM feedback where deleted = 0")
    Page<Feedback> selectFeedBackList(Page<Feedback> page);
}
